@use '@/style/glass-card.scss' as *;

.disk-io-stats-container {
  padding: 20px 0;
}

.disk-io-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 24px;
}

.disk-io-stats-card {
  @extend .glass-card;
}

.disk-io-stats-header {
  @extend .glass-card-header;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.connection-status {
  font-size: 0.9rem;
  font-weight: 400;
  margin-left: auto;

  &.connected {
    color: #4ade80;
  }

  &:not(.connected) {
    color: #fbbf24;
  }
}

.disk-io-stats-item {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);

  &:last-child {
    border-bottom: none;
  }

  .disk-io-stats-label {
    font-weight: 500;
    color: rgba(255, 255, 255, 0.8);
  }

  .disk-io-stats-value {
    color: #fff;
    font-weight: 500;
  }
}

.usage-bar-container {
  margin-top: 12px;
}

.usage-bar {
  height: 12px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  overflow: hidden;
}

.usage-bar-fill {
  height: 100%;
  border-radius: 6px;
  transition: width 0.5s ease;
}

.usage-bar-fill.danger {
  background: linear-gradient(90deg, #ff6b6b, #ff8e8e);
  box-shadow: 0 0 8px rgba(255, 107, 107, 0.5);
}

.usage-bar-fill.warning {
  background: linear-gradient(90deg, #f39c12, #f5b041);
  box-shadow: 0 0 8px rgba(243, 156, 18, 0.5);
}

.usage-bar-fill.success {
  background: linear-gradient(90deg, #2ecc71, #58d68d);
  box-shadow: 0 0 8px rgba(46, 204, 113, 0.5);
}

.loading {
  text-align: center;
  color: rgba(255, 255, 255, 0.5);
  padding: 2rem;
}

.error {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1rem;
  color: #fca5a5;
  text-align: center;
}

.no-data {
  text-align: center;
  color: rgba(255, 255, 255, 0.5);
  padding: 2rem;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-top-color: #4ade80;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 1rem;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
